depositaccountlist={'t1':'123456'}
accountbalances={'t1':float(0)}
def register(depositaccount,password):
    if depositaccount in depositaccountlist:
        print("account already exists, please re-type")
        return 0
    else:
        depositaccountlist.update({depositaccount:password})
        accountbalances.update({depositaccount:float(0)})
        print("register successed")
def login(depositaccount,password):
    if password == depositaccountlist[depositaccount]:
        print("sign up")
        global account
        account=depositaccount
        return 1
    else:
        print("password not right")
def deposit(num):
    global account
    accountbalances[account]+=num
def withdraw(num):
    global account
    if num<=accountbalances[account]:
        accountbalances[account]-=num
    else:
        print("overcertify")

while True:
    action=input("1.reg 2.signup 3.quit:")
    if action=='1':
        depositaccount=input("input account:")
        password=input("input password:")
        register(depositaccount,password)
    if action=='2':
        depositaccount = input("input account:")
        password = input("input password:")
        if login(depositaccount,password):
            account=depositaccount
            break
    if action=='3':
        exit(8)
while True:
    action=input("1.deposit 2.withdraw 3.check balances 4.quit:")
    if action=='1':
        num=input("please input how much you want to deposit:")
        if num.isdigit():
            if float(num)>0:
                deposit(float(num))
            else:
                print("input error")
        else:
            print("input errot")
    if action=='2':
        num=input("please input how much you want to withdraw:")
        if num.isdigit():
            if float(num)>0:
                withdraw(float(num))
            else:
                print("input error")
        else:
            print("input errot")
    if action=='3':
        print("BALANCES: {0}".format(accountbalances[account]))
    if action=='4':
        print("BALANCES: {0}".format(accountbalances[account]))
        break